$().ready(function(){
	//输入框验证
	//创建钱包
	$(".Append_content2").on("click",function(){
		var wallet=$("[name='walletAdd']").val();
		var password=$("[name='password']").val();
		var repassword=$("[name='repassword']").val();
		if(wallet.length==0){
			$(".Append_content .input-err>div").html("请输入钱包地址").css("display","block");
			return true;
		}
		if(password.length==0){
			$(".Append_content .input-err>div").html("请输入钱包密码").css("display","block");
			return true;
		}else if(password.length<7){
			$(".Append_content .input-err>div").html("钱包密码至少为8位").css("display","block");
			return true;
		}
		if(repassword.length==0){
			$(".Append_content .input-err>div").html("请输入重复钱包密码").css("display","block");
			return true;
		}else if(repassword!==password){
			$(".Append_content .input-err>div").html("两次密码不相同，请重新输入").css("display","block");
			return true;
		}
		var more={};
		more.wallet=wallet;//钱包名称
		more.password=password;//钱包密码
		more.passwordNotice=$("[name='passwordnot']").val();//钱包提示
		$.ajax({
			url:"/app/coldwallet/creatwallet",
			type:"POST",
			data:{"walletname":wallet,"password":password,"passwordnotice":more.passwordNotice},
			success:function(r){
				//console.log(r);
				if(r.code==0){
					var codeAdd={};
					codeAdd.address=r.walletEntity.address;
					codeAdd.walletid=r.walletEntity.id;
					codeAdd=JSON.stringify(codeAdd);
					sessionStorage.setItem("codeAdd",codeAdd);
					location.href="Token_append_money1.html";
				}else{
					alert("创建失败！");
				}
			}
		})
        //location.href="Token_append_money1.html";
    })
})